<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../header.jsp">
	<jsp:param value="创建学员 - 教员界面" name="title"/>
</jsp:include>
<link href="static/css/teacher.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="static/js/employ.js"></script>
<script type="text/javascript">
$(function(){
	$('.selection.dropdown,select.dropdown').dropdown();
});

</script>
</head>
<body>
	<jsp:include page="../menu/manage_menu.jsp"></jsp:include>
	<div class="teacher-content">
		<form  method="post" class="ui form create-form">
			<!-- 如果是新建这里没有值 -->
		  <input type="hidden" name="eid" value="${e.id }">
		  
		  <div class="field">
		    <label>部门</label>
		    <div class="ui selection dropdown">
		          <input type="hidden" name="dept" value="${e.deptId }">
		          <i class="dropdown icon"></i>
		          <div class="default text">请选择部门</div>
		          <div class="menu">
		          	 <c:forEach items="${deptList }" var="dept">
		              <div class="item" data-value="${dept.id }">${dept.deptName }</div>
		              </c:forEach>
		          </div>
		      </div>
		  </div>
		  <div class="field">
		    <label>姓名</label>
		    <input type="text" name="userName" 
		    <c:choose> 
		   		<c:when test="${e.userName==null}">
		    		value="${param.userName }"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.userName }"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  
		  <div class="field">
		    <label>密码</label>
		    <input type="text" name="password" 
		    <c:choose> 
		   		<c:when test="${e.password==null}">
		    		value="${param.password }"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.password }"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  
		  <div class="field">
		    <label>性别</label>
		    <select class="ui fluid dropdown" name="gender">
		    	<c:choose>
		    		<c:when test="${e.gender==null }">
		    		<option	${param.gender eq '男' ? 'selected' : '' }></option>
		   			<option	${param.gender eq '男' ? 'selected' : '' }>男</option>
		    		<option ${param.gender eq '女' ? 'selected' : '' }>女</option>
		    		</c:when>
		    		<c:otherwise>
		    		<option	${e.gender eq '男' ? 'selected' : '' }></option>
		   			<option	${e.gender eq '男' ? 'selected' : '' }>男</option>
		    		<option ${e.gender eq '女' ? 'selected' : '' }>女</option>
		    		</c:otherwise>
		    	</c:choose>
		    </select>
		  </div>
		   <div class="field">
		    <label>电话</label>
		    <input type="text" name="telphone"  
		    <c:choose> 
		   		<c:when test="${e.telphone==null}">
		    		value="${param.telphone }"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.telphone}"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  <div class="field">
		    <label>邮箱</label>
		    <input type="text" name="email"  
		    <c:choose> 
		   		<c:when test="${e.email==null}">
		    		value="${param.email }"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.email}"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  <div class="field">
		    <label>地址</label>
		    <input type="text" name="address"  
		    <c:choose> 
		   		<c:when test="${e.address==null}">
		    		value="${param.address }"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.address}"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  <div class="field">
		    <label>员工类型</label>
		    <input type="text" name="empType"  
		    <c:choose> 
		   		<c:when test="${e.emploType==null}">
		    		value="${param.empType}"
		    	</c:when>
		     	<c:otherwise>
		    	 	value="${e.emploType}"
		   		</c:otherwise>
		    </c:choose>>
		  </div>
		  <button class="ui button" type="submit">${empty e ?'创建':'保存' }</button>
		  <span>${error }</span>
		</form>
	</div>
</body>
</html>